package com.hxd.common;

import java.util.Map;

import com.hxd.base.BaseEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class Page<T extends BaseEntity> extends com.baomidou.mybatisplus.extension.plugins.pagination.Page<T> {
	
	private static final long serialVersionUID = 1L;

	public Page(long current, long size) {
		super(current, size);
	}
	
	public Page(Map<String, Object> params) {
        super(Long.parseLong(params.get("pageNum") + ""), Long.parseLong(params.get("pageSize") + ""));
    }
	
	public Page(T t) {
        super(t.getPageNum() > 0 ? t.getPageNum() : 1, t.getPageSize() > 0 ? t.getPageSize() : 10);
    }
}
